package cn.ixp.agent;

import cn.ixp.agent.transformer.InjectMethodCostTimeTransformer;
import cn.ixp.agent.transformer.MyClassFileTransformer;

import java.lang.instrument.Instrumentation;
import java.lang.instrument.UnmodifiableClassException;

public class InAgentMain {
    public static void agentmain(String agentArgs, Instrumentation inst){
        inst.addTransformer(new InjectMethodCostTimeTransformer(), true);
        try {
            for (Class innerClass : inst.getAllLoadedClasses()) {
                if (innerClass.getName().contains("com.ylzinfo.apps")) {
                    inst.retransformClasses(innerClass);
                }
            }
        } catch (UnmodifiableClassException e) {
            System.out.println("出错");
            throw new RuntimeException(e);
        }
    }

    public static void main(String[] args) {

    }
}
